﻿using System;
using OscarClover.Packets;

namespace OscarClover.BuddyManagment
{
    public class Group:SsiItem
    {
        public Group(string name, ushort groupId, ushort itemId, TlvList tlvList) : base(name, groupId, itemId, 0x01, tlvList)
        {
        }

        public ushort this[int index]
        {
            get
            {
                try
                {
                    return (ushort)(TlvList[0xc8].Value[index * 2 - 1] * 256 + TlvList[0xc8].Value[index * 2]);
                }
                catch (System.Exception e)
                {
                    throw new NullReferenceException("Tlv Not Found!",e);
                }
                
            }
        }
    }
}
